// import {
//   getRegularConfigurations as getMesRegularConfigurationList,
//   // getIsDbcheckList as getMesRegularConfigurationIsDbcheckList,
// } from '@/api/process/mesProcessMaterial'
import {
  getRegularList
} from '../../../api/process/mesProcessMaterial'

export const mesRegularConfigurationDialog = {
  data() {
    return {
      mesRegularConfigurationDialogVisible: false, //表格弹框隐藏显示
      getRegularList, // 获取弹框数据接口
      hasMesRegularConfigurationFooter: true, // 是否需要底部按钮默认true
      mesRegularConfigurationSearchDialog: {
        inline: true,
        formDesc: {
          regularCode: {
            type: 'input',
            layout: 8,
            label: $i18n.t('mesProcess.regularCode')
          },
          regularName: {
            type: 'input',
            layout: 8,
            label: $i18n.t('mesProcess.regularName1')
          },
          regularContent: {
            type: 'input',
            layout: 8,
            label: $i18n.t('mesProcess.regularContent')
          }
        }
      },
      mesRegularConfigurationDialogColumn: [
        {
          type: 'selection'
        },
        {
          type: 'index',
          label: $i18n.t('common.order'),
          width: 60
        },
        {
          prop: 'regularCode',
          label: $i18n.t('mesProcess.regularCode'),
          minWidth: 120,
          showOverflowTooltip: true
        },
        {
          prop: 'regularName',
          label: $i18n.t('mesProcess.regularName1'),
          minWidth: 180,
          showOverflowTooltip: true
        },
        {
          prop: 'regularContent',
          label: $i18n.t('mesProcess.regularContent'),
          minWidth: 180,
          showOverflowTooltip: true
        },
        // {
        //   prop: "isDbcheck",
        //   label: "是否db验证0不验证1验证",
        //   optionProp: {
        //     value: "value",
        //     label: "description",
        //   },
        //   option: async (data) => {
        //     const list = await getMesRegularConfigurationIsDbcheckList()
        //     return list.data.result
        //   },
        // },
        // {
        //   prop: 'factoryCode',
        //   label: $i18n.t('mesProcess.factoryCode'),
        //   showOverflowTooltip: true,
        //   minWidth: 140
        // },
        {
          prop: 'remark',
          label: $i18n.t('common.remark'),
          showOverflowTooltip: true,
          minWidth: 180,
        }
      ]
    }
  },
  methods: {
    // 弹框表格，双击表格，或者点击确定 返回选中数据
    getSelectMesRegularConfiguration(data) {
      if (!data.length) {
        this.$set(this.formDataDialog, 'regularCode',"")
        this.$set(this.formDataDialog, 'regularName', "")
        this.$set(this.formDataDialog, 'regularContent', "")
      } else {
        this.$set(this.formDataDialog, 'regularCode', data[0].regularCode)
        this.$set(this.formDataDialog, 'regularName', data[0].regularName)
        this.$set(this.formDataDialog, 'regularContent', data[0].regularContent)
      }
      // 调试完成记得删除控制台打印
      // console.log("选中数据", data);
      // 这里可以自定义返回字段信息
      // 第一个入参为当前表单绑定的对象，第二个入参为要修改的字段名，第三个入参为选中数据中相应信息
   
    }
  }
}
